package com.niuwa.p2p.core.constant;

/**
 * 
 * @title 短信状态枚举值对象
 *
 * @author tennyqin
 * @version 1.0
 * @created 2015年3月25日
 */
public enum SmsStatusEnum implements IEnum {

	Success(0, "成功"), NoMoney(-1, "余额不足"), ErrorAccount(-2, "账号或密码错误"), UnConnection(
			-3, "连接服务商失败"), OutTime(-4, "超时"), NetConnection(-5, "网络问题，IP受限"), NullContent(
			-6, "短信内容为空"), NullMobile(-7, "目标号码为空"), ErrorChannel(-8, "通道设置不对"), UnKonowException(
			-9, "捕获未知异常"), MoreMaxTime(-10, "超过最大定时时间限制"), BlackList(-11,
			"目标号码在黑名单里"), ErrorWords(-12, "消息内容包含禁用词语"), NoPower(-13,
			"没有权限使用该网关"), NoChannelID(-14, "找不到对应的ChannelID"), NoSubmitPower(
			-17, "没有提交权限"), SoFastSub(-20, "超速提交"), Other(-403, "不符合个性化短信格式"), ErrorSign(
			-404, "短信签名错误");

	private int value;
	private String text;

	private SmsStatusEnum(int value, String text) {
		this.value = value;
		this.text = text;
	}

	@Override
	public int getValue() {
		return this.value;
	}

	@Override
	public String getText() {
		return this.text;
	}

	@Override
	public String toString() {
		return this.getText();
	}

	public static SmsStatusEnum valueOf(int value) {
		for (SmsStatusEnum e : SmsStatusEnum.values()) {
			if (e.getValue() == value) {
				return e;
			}
		}
		return null;
	}

}
